/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eng.scc.core.view;

import com.eng.scc.core.parts.AbstractApplicationAction;
import com.eng.scc.core.parts.ActionCategory;
import com.eng.scc.core.parts.CrudActions;
import java.awt.event.ActionEvent;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;

/**
 *
 * @author Rafael
 */
public abstract class ApplicationView extends JPanel implements CrudActions
{
    public abstract void refreshContent();
    public abstract List<ActionCategory> getViewActions();
    
    public JComponent getInitialFocus()
    {
        return null;
    }
    
    protected String getAddName()
    {
        return "Adicionar";
    }
    
    protected String getEditName()
    {
        return "Editar";
    }
    protected String getDeleteName()
    {
        return "Excluir";
    }
    
    protected AbstractApplicationAction btAdd = new AbstractApplicationAction( getAddName(), "tb_add.png" )
    {
        @Override
        public void actionPerformed( ActionEvent e )
        {
            add();
        }
    };
    
    protected AbstractApplicationAction btEdit = new AbstractApplicationAction( getEditName(), "tb_edit.png" )
    {
        @Override
        public void actionPerformed( ActionEvent e )
        {
            edit();
        }
    };
    
    protected AbstractApplicationAction btDelete = new AbstractApplicationAction( getDeleteName(), "tb_delete.png" )
    {
        @Override
        public void actionPerformed( ActionEvent e )
        {
            delete();
        }
    };
}
